<?php
/*------------------------------------------------------------------------
 # Copyright (c) 2014 YouTech Company. All Rights Reserved.
 # @license - Copyrighted Commercial Software
 # Author: YouTech Company
 # Websites: http://www.magentech.com
-------------------------------------------------------------------------*/

global $var_yttheme;  
// Include cpanel
if( $var_yttheme->getParam('showCpanel') ) { ?>
<div id="cpanel_wrapper" style="direction: ltr">
	<div class="cpanel-head">
		<span>Template Settings</span>
		<div class="action cpanel-reset">
			<!--<input id="yt_button_cpanel" class="btn btn-info" type="button" onclick="javascript: onCPApply();" value="Apply" class="button" />-->
			<a class="btn btn-info reset" href="javascript:void(0);" onclick="javascript: onCPResetDefault(TMPL_COOKIE);">Reset</a>
		</div>		
	</div>

	
	<div class="accordion" id="ytcpanel_accordion">
		<!--Theme-->
        <div class="accordion-group cpanel-theme cpanel-theme-color">
            <div class="accordion-heading">
                <a class="accordion-toggle"  data-parent="#ytcpanel_accordion">			
					Theme Color
				</a>
            </div>
        	<div id="ytitem_1" class="accordion-theme">
                <div class="accordion-inner clearfix">
					<div class="color-theme">
						<span title="Red" class="theme-color red<?php echo ($var_yttheme->getParam('sitestyle')=='red')?' active':'';?>">Red</span>
						<span title="Violet" class="theme-color violet<?php echo ($var_yttheme->getParam('sitestyle')=='violet')?' active':'';?>">Violet</span>
						<span title="Green" class="theme-color green<?php echo ($var_yttheme->getParam('sitestyle')=='green')?' active':'';?>">Green</span>
						<span title="Blue" class="theme-color blue<?php echo ($var_yttheme->getParam('sitestyle')=='blue')?' active':'';?>">Blue</span>
						<span title="Orange" class="theme-color orange<?php echo ($var_yttheme->getParam('sitestyle')=='orange')?' active':'';?>">Orange</span>
						
					</div>
				</div>
			</div>
        </div>
	
		<!--Store-->
		
			

		<!-- Menu -->
		<div class="accordion-group cpanel-menu">
			<div class="accordion-heading">
				<a class="accordion-toggle" data-parent="#ytcpanel_accordion">
				Menu style </a>
			</div>
			<div id="ytitem_6" class="accordion-body">
				<div class="accordion-inner clearfix">
					<!-- Styles -->
					<div class="cp-item footer-background-color">
						<!--span>Styles</span-->
						<div class="inner">
							<select onchange="javascript: onCPApply();" name="ytcpanel_menustyle" class="cp_select">
								<option value="mega" <?php echo ($var_yttheme->getParam('menustyle')=='mega')?' selected="selected"':'';?>>Mega</option>
								<option value="css" <?php echo ($var_yttheme->getParam('menustyle')=='css')?' selected="selected"':'';?>>Css</option>
								
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div id="cpanel_btn" class="normal">
		<i class="icon-hand-left"></i>
	</div>
</div>

<script type="text/javascript">
	// <![CDATA[
    $jsmart(document).ready(function($){
		function templateSetting(array){
			if(array['0']){
				$('.body-background-color input.miniColors').attr('value', array['0']);
				$('.body-background-color a.miniColors-trigger').css('background-color', array['0']);
				$('input.ytcpanel_bgcolor').attr('value', array['0']);
			}
			if(array['1']){
				$('.link-color input.miniColors').attr('value', array['1']);
				$('.link-color a.miniColors-trigger').css('background-color', array['1']);
				$('input.ytcpanel_linkcolor').attr('value', array['1']);
			}
			if(array['2']){
				$('.text-color input.miniColors').attr('value', array['2']);
				$('.text-color a.miniColors-trigger').css('background-color', array['2']);
				$('input.ytcpanel_textcolor').attr('value', array['2']);
			}
			if(array['3']){
				$('.header-background-color input.miniColors').attr('value', array['3']);
				$('.header-background-color a.miniColors-trigger').css('background-color', array['3']);
				$('input.ytcpanel_header-bgcolor').attr('value', array['3']);
			}
			if(array['4']){
				$('.header-background-image .pattern').removeClass('active');
				$('.header-background-image .pattern.'+array['4']).addClass('active');
				$('input[name$="ytcpanel_header-bgimage"]').attr('value', array['4']);
			}
			if(array['5']){
				$('.footer-background-color input.miniColors').attr('value', array['5']);
				$('.footer-background-color a.miniColors-trigger').css('background-color', array['5']);
				$('input.ytcpanel_footer-bgcolor').attr('value', array['5']);
			}
			if(array['6']){
				$('.footer-background-image .pattern').removeClass('active');
				$('.footer-background-image .pattern.'+array['6']).addClass('active');
				$('input[name$="ytcpanel_footer-bgimage"]').attr('value', array['6']);
			}
			if(array['7']){
				$('.body-background-image .pattern').removeClass('active');
				$('.body-background-image .pattern.'+array['7']).addClass('active');
				$('input[name$="ytcpanel_body-bgimage"]').attr('value', array['7']);
			}
		}
		
		var array 			= Array('bgcolor','linkcolor','textcolor');
		var array_violet 		= Array('#FFFFFF','#666666',  '#666666');
		var array_green		= Array('#FFFFFF','#666666',  '#666666');
		var array_blue 		= Array('#FFFFFF','#666666',  '#666666');
		var array_orange   	= Array('#FFFFFF','#666666',  '#666666');
		var array_red   	= Array('#FFFFFF','#666666',  '#666666');
		var array_yellow   	= Array('#FFFFFF','#666666',  '#666666');

		$('.theme-color.red').click(function(){
			$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
			createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
			templateSetting(array_red);
			onCPApply();
		});
		$('.theme-color.violet').click(function(){
			$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
			createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
			templateSetting(array_violet);
			onCPApply();
		});
		$('.theme-color.blue').click(function(){
			$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
			createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
			templateSetting(array_blue);
			onCPApply();
		});
		$('.theme-color.green').click(function(){
			$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
			createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
			templateSetting(array_green);
			onCPApply();
		});
		$('.theme-color.orange').click(function(){
			$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
			createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
			templateSetting(array_orange);
			onCPApply();
		});
		$('.theme-color.yellow').click(function(){
			$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
			createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
			templateSetting(array_yellow);
			onCPApply();
		});		
    });
	// ]]>
    </script>
<?php } ?>

<?php
if(!defined('ACCORDION_SNYDERPLACE')){
    define('ACCORDION_SNYDERPLACE', 1);
?>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.cookie.min.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.accordion_snyderplace.js') ?>"></script>
<?php } ?>

